package prototype.demo.run;

import prototype.demo.bean.Bean1;
import prototype.demo.bean.Bean2;
import prototype.demo.copyPlus.Bean3;
import prototype.demo.copyPlus.Bean4;

import java.math.BigDecimal;
import java.util.ArrayList;

public class RunCopyPlus {
//    public static void main(String[] args) {
//
//        Bean1 bean1 = new Bean1(1L, "真实姓名", "昵称", 1, "密码", "邮箱", "手机", new ArrayList<Long>(), new ArrayList<Long>(), new BigDecimal("9"), new BigDecimal("19"));
//        Bean2 bean2 = new Bean2(1L, "真实姓名", "昵称", 1, "密码", "邮箱", "手机", new ArrayList<Long>(), new ArrayList<Long>(), new BigDecimal("9"), new BigDecimal("19"));
//        Bean3 bean3 = new Bean3(bean1, bean2);
//        try {
//            Bean3 bean3Copy1 = (Bean3) bean3.clone();
//            System.out.println(bean3);
//            System.out.println(bean3Copy1);
//            System.out.println("=================");
//            bean1.setRealName("真实姓名修改了..");
//            System.out.println(bean3);
//            System.out.println(bean3Copy1);
//        } catch (CloneNotSupportedException e) {
//            e.printStackTrace();
//        }
//    }

    public static void main(String[] args) {
        Bean1 bean1 = new Bean1(1L, "真实姓名", "昵称", 1, "密码", "邮箱", "手机", new ArrayList<Long>(), new ArrayList<Long>(), new BigDecimal("9"), new BigDecimal("19"));
        Bean2 bean2 = new Bean2(1L, "真实姓名", "昵称", 1, "密码", "邮箱", "手机", new ArrayList<Long>(), new ArrayList<Long>(), new BigDecimal("9"), new BigDecimal("19"));
        Bean4 bean4 = new Bean4(bean1, bean2);
        Bean4 clone = (Bean4) bean4.cloneObject();
        System.out.println(bean4);
        System.out.println(clone);
        System.out.println("=========================");
        bean1.setRealName("真实姓名修改了..");
        System.out.println(bean4);
        System.out.println(clone);
    }
}

